﻿using System.Web.Mvc;

namespace ExcellentCRM.Site.Exts
{
    public static class HtmlExtensions
    {
         public static string CreateSummary(this HtmlHelper html, string commentStr, int minStrNum = 20,
                                                   string ellipsis = "......")
         {
             if (string.IsNullOrWhiteSpace(commentStr) || commentStr.Length <= minStrNum) return commentStr;
             return string.Format("{0}{1}", commentStr.Substring(0, minStrNum), ellipsis);
         }
    }
}